<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
      <!-- 1.基本使用 -->
        <h2>当前计数：{{message}}</h2>
      <!-- 2.表达式 -->
        <h2>计数双倍：{{ counter * 2 }}</h2>
        <h2>展示信息：{{ infos.split(" ") }}</h2>
      <!-- 3.三元运算符 -->
        <h2>{{ age >= 18? "成年人":"未成年人" }}</h2>
      <!-- 4.注意：这里不能定义语句 -->
      <!-- 5.调用methods函数 -->
        <h2>{{formateDate(time)}}</h2>
    </div>

    <script src="./lib/Vue.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return{
                  message:"Hello Vue",
                  counter:0,
                  infos:"my name is why",
                  age:22,
                  time:123
                }
            },
            methods:{
              formateDate(data){
                return "2022-10-10-"+data
              }
            }
        })
        app.mount("#app")
    </script>
</body>
</html>